package com.study.happystudy.service;

import com.study.happystudy.po.Message;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface MessageService {
    // 1. 私信发送
    int sendPrivateMessage(@Param("senderId") int senderId, @Param("receiverId") int receiverId, @Param("messageContent") String messageContent);

    // 2. 私信撤回(类似删除)
    int revokePrivateMessage(@Param("messageId") int messageId);

    // 3. 根据id返回信息
    Message getMessageById(@Param("messageId") int messageId);

    // 4. 根据id删除信息
    int deleteMessageById(@Param("messageId") int messageId);

    // 5. 系统信息发送
    int sendSystemMessage(@Param("senderId") int senderId, @Param("receiverId") int receiverId, @Param("messageContent") String messageContent);

    // 6. 课程信息发送
    int sendCourseMessage(@Param("senderId") int senderId, @Param("receiverId") int receiverId, @Param("messageContent") String messageContent);

    // 7. 活动信息发送
    int sendActivityMessage(@Param("senderId") int senderId, @Param("receiverId") int receiverId, @Param("messageContent") String messageContent);

    // 8. 社区信息发送
    int sendCommunityMessage(@Param("senderId") int senderId, @Param("receiverId") int receiverId, @Param("messageContent") String messageContent);

    // 9. 根据关键词查找消息(sender_id,receiver_id = id)
    List<Message> searchMessagesByKeyword(@Param("userId") int userId, @Param("keyword") String keyword);
}
